package com.meessiom.train.crm.user.repository;

import com.meessiom.train.crm.customer.model.Customer;
import com.meessiom.train.crm.user.model.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface UserRepository extends JpaRepository<User,Long>, JpaSpecificationExecutor {
    @Query(value = "select user_name from users where id = ?", nativeQuery = true)
    public String getUserNameByUserId(long id);


    public List<User> findUserByUserNameLikeAndUserPhoneLikeAndUserAddressLike

            (@Param("name") String name, @Param("phone") String phone, @Param("address") String address);

}
